import request from "@/plugins/axios";

const API_PREFIX = '/api/result'

export function reply({ questionId, content }) {
  const data = { questionId, content }
  return request.post(`${API_PREFIX}/reply`, data)
}

export function getResultsByQuestionId(questionId) {
  return request.get(`${API_PREFIX}/listByQuestionId`, { params: { questionId } })
}

export function deleteResult(resultId) {
  const data = { resultId }
  return request.post(`${API_PREFIX}/delete`, data)
}

export function editResult({ resultId, content }) {
  const data = { resultId, content }
  return request.post(`${API_PREFIX}/edit`, data)
}